package com.whynot.frame.designMode.factory.main;

import com.whynot.frame.designMode.factory.creator.ConcreteCyPersonAbstractFatory;
import com.whynot.frame.designMode.factory.creator.PersonAbstractFatory;
import com.whynot.frame.designMode.factory.producter.Badminton;
import com.whynot.frame.designMode.factory.producter.Basketball;
import com.whynot.frame.designMode.factory.producter.Football;
import com.whynot.frame.designMode.factory.producter.Badminton;
import com.whynot.frame.designMode.factory.producter.Basketball;
import com.whynot.frame.designMode.factory.producter.Football;

public class Client {
	public static void main(String[] args) {
		PersonAbstractFatory fatory = new ConcreteCyPersonAbstractFatory();
		//这里不需要new，自己去创建对象。而是通过工厂去创建
		Badminton badminton = fatory.newInstance(Badminton.class);
		badminton.play();
		Basketball basketball = new Basketball();
		basketball.play();
		Football football = new Football();
		football.play();
	}
}
